feat(#352 typesync.v2 | cli): buildout a CLI from the hypergraph package to read schema/mapping files#418
Merged
Merged
Conversation
…ma and mapping files
….whited/typesync.v2/cli
…raph schema/mapping and emit on stream
….whited/typesync.v2/cli
….whited/typesync.v2/cli
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Reference #352
There is a lot more to come out of this work, but this felt like a logical starting point.
The goal is to take the current
@graphprotocol/hypergraph-cliand package it with the@graphprotocol/hypergraphpackage that will be runnable if the user has the package installed as a dependency. And instead of using sqlite to create/manage multiple hypergraph schemas (apps), the cli tool will only deal with the hypergraph schema/mapping in the repo/directory the cli tool is ran in.It uses logical placements of the schema/mapping files in the directory (will likely need to expand on this, maybe a config will become handy to point to the schema/mapping files??). If these files can be found, it parses the schema and mapping files to build a
Schemainstance and emit this value on a streaming endpoint.The cli exposes a simple api that:
/api/v1/schema/eventsthat emits a SSE stream ofSchemabuilt fromSchemaNotes
schema.tscan't be found, the streaming endpoint returns an emptySchemaobject. Other way to handle it would be to throw an error from the cli if it can't be found to let the user know. Anyone have thoughts?